Chapter 7 Geospatial Analysis
Might take times to render
listing <- read_csv(file="listings.csv")
listing <- within(listing, rm(X8, X13, X49, license, jurisdiction_names, square_feet, monthly_price, weekly_price))
listing <- listing %>% filter(is_location_exact == "TRUE")
listing$price <- parse_number(listing$price)Firstly, delete the comparing meaningless variables and change the data type of the variable ‘price’ into numeric so that we could easily address it and get its summary statistics.
Use the geojson-format data to represent the border of the neighbourhoods in New York City and use it to get summary of the data’s features that lie in the area.
With the help of library ‘leaflet’, we try to merge different layers into one single map to exhaustively analysis the correlation between home building factors and the location factors. As we can see in the map, the map concludes different layers. We can easily display or remove the layer by clicking the check buttons before the layer’s names. We can use the combination of different layers to show different correlation patterns:
7.1 Study of Variable ‘Room type’
By clicking only the ‘Room_type’, we can display all the listing data on the map to show its geographical distribution. From the map we can find that homes with room type as ‘Entire home/apt’ and ‘Private room’ tend to be the two most common types of the rental house type accross New York. Meanwhile, the rental houses are evernly distributted across Manhattan and Brooklyn except in the Staten Island, Bronx and and Queens.We think that this is due to the geographical restriction or the lack number of tourists. By changing the base map into ‘Satellite’, we can see from the map that there are certain desolate areas in the western and northwestern side in the Staten Island. This happens to be the area that rental houses are not located, which explains the unevenly distribution of the rental houses in Staten Island. In Bronx and Queens, the areas that do not have rental houses are those areas which are remote from downtown areas. The lack of tourists may lead to this situation.
7.2 Study of Variable ‘Room count’
By clicking only the ‘Room_count’, we can get summary of the number of listing data that locates in different neighbourhoods in New York City. From the legend shown in the lower left, we can see that larger values come with deeper color. Meanwhile, we can click the neighbourhoods on map to get its name with the summary value. From the map we can find that the number of rental houses in Williamsburg, Bedford-Stuyvesant and Harlem is comparing larger than the rest of the counties. Tourists may be interested in these neighborhood because of its history and its beautiful brownstones(Bedford-Stuyvesant). Meanwhile, we can find that the number of rental houses in Manhattan is greater than the rest of the areas. It may due to the convenience of the transition and the high population. Besides, we are interesed to find that the areas with greater number corresponds with subway line presence.